<template>
  <div class="fixedTotal">
    <div class="total">
      <div class="info">
        <div class="money">
          <span class="num"
            >已选<span>{{ confirmData.quantity }}</span
            >件，合计</span
          >
          <nut-price
            :price="confirmData.payAmount"
            size="normal"
            position="after"
            symbol="元"
          />
        </div>
      </div>
      <div class="btn">
        <nut-button
          type="primary"
          :loading="loading"
          :disabled="loading"
          @click="emits('submit')"
          >{{ hasSubmit ? "去支付" : "去结算" }}</nut-button
        >
      </div>
    </div>
  </div>
</template>

<script setup>
import { defineProps, defineEmits } from "vue";

// 属性
const props = defineProps({
  confirmData: {
    type: Object,
  },
  hasSubmit: {
    type: Boolean,
  },
  loading: {
    type: Boolean,
  },
});

// 方法
const emits = defineEmits(["submit"]);
</script>

<style lang="less" scoped>
.fixedTotal {
  background: #fff;
  width: 100%;
  position: fixed;
  bottom: 0px;
  .total {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 10px;
    .info {
      display: flex;
      justify-content: flex-start;
      .money {
        display: flex;
        align-items: center;
        .num {
          margin-right: 5px;
          span {
            margin: 0px 5px;
          }
        }
      }
    }
    .btn {
      :deep(.nut-button) {
        display: flex;
        font-size: 13px;
        align-items: center;
      }
    }
  }
}
</style>